<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/layui.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/view.css" />
    <title>选课页面</title>
</head>
<body class="layui-view-body">
<div class="layui-content">
    <div class="layui-page-header">
        <div class="pagewrap " style=" padding: 1px 20px;">
            <span class="layui-breadcrumb"> </span>
            <h2 class="title">选课信息</h2>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-card" style="padding: 1vw">
            <div class="layui-card-header" style="position:relative;">
               <span style="font-size: 1.5em;font-weight: 900; "> 学生编号：</span> <stong style="font-size: 1.3em;margin-right: 2em;color: #20bf6b;font-weight: 600">${student.sno}</stong>
               <span style="font-size: 1.5em;font-weight: 900; "> 学生姓名：</span> <stong style="font-size: 1.3em;color: #20bf6b;font-weight: 600">${student.name}</stong>
                <a href="${pageContext.request.contextPath}/stu/toFindStuAllPage/1/5" class="layui-btn layui-btn-primary" style="float: right">返回</a>
            </div>
            <table class="layui-table">
                <colgroup>
                    <col width="150" />
                    <col width="200" />
                    <col />
                </colgroup>
                <thead>
                <tr>
                    <th class="mywidth2">课程号</th>
                    <th class="mywidth2">课程名称</th>
                    <th class="mywidth2">先修课程</th>
                    <th class="mywidth2">学分</th>
                </tr>
                </thead>

                <tbody>
                <c:forEach var="lesson" items="${lessons}">
                    <tr>
                        <td>${lesson.lno}</td>
                        <td>${lesson.name}</td>
                        <td>${lesson.plName}</td>
                        <td>${lesson.credit}</td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <fieldset class="layui-elem-field">
                <legend>选课目录</legend>
                <div class="layui-field-box">
                    <form class="layui-form layui-card-body" action="${pageContext.request.contextPath}/stu/selectLesson/${id}" method="post">

                        <c:forEach var="lesson" items="${lessonList}">
                            <div class="layui-input-inline"   style="width: 146px;margin-left: 3% ">
                                <input type="checkbox" name="selectList"

                                       value="${lesson.lno}" title="${lesson.lno}.${lesson.name}" <c:if test="${selectList.contains(lesson.lno)}">checked</c:if> >
                            </div>
                        </c:forEach>

                        <div class="layui-form-item">
                            <div class="layui-input-block" style="left: 30%;margin: 24px; ">
                                <button style=" padding: 0 51px" class="layui-btn layui-btn-success" lay-submit lay-filter="formDemo" >
                                    立即提交
                                </button>
                                <button  style=" padding: 0 51px;width: 153px" type="reset" class="layui-btn layui-btn-warm ">
                                    重置
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </fieldset>


        </div>
    </div>
</div>

<script src="${pageContext.request.contextPath}/assets/layui.all.js"></script>
<script>
    let form = layui.form,
        layer = layui.layer;
</script>
</body>
</html>
